package cn.kai.enums;

import lombok.Getter;

/**
 * 是否 相关枚举
 * Author: cKnight
 * Date: 2024/6/9
 */
@Getter
public enum BooleanEnum {
    YES("是","YES"),
    NO("否","NO"),

    ONE("是","1"),
    ZERO("否","0"),

    ON("开启","ON"),
    OFF("关闭","OFF"),

    START("开始","START"),
    END("结束","END"),

    SUCCESS("成功","SUCCESS"),
    FAIL("失败","FAIL"),
    ;


    public static Boolean convert(String value){
        BooleanEnum booleanEnum = BooleanEnum.valueOf(value);
        switch (booleanEnum){
            case YES:
                return Boolean.TRUE;
            case ON:
                return Boolean.TRUE;
            case SUCCESS:
                return Boolean.TRUE;
            case START:
                return Boolean.TRUE;
            case ONE:
                return Boolean.TRUE;
            default:return Boolean.FALSE;
        }
    }

    private String label;
    private String value;


    BooleanEnum(String label, String value) {
        this.label = label;
        this.value = value;
    }
}
